#include "commandline.h"
#include "command.h"


CommandLine::CommandLine()
{
}

CommandLine::~CommandLine()
{
    for (std::vector<Command *>::iterator i=commands.begin(); i!=commands.end(); ++i)
    {
        delete *i;
    }
}

void CommandLine::addCommand(Command * command)
{
    commands.push_back(command);
}

void CommandLine::execute()
{
    for (std::vector<Command *>::iterator i=commands.begin(); i!=commands.end(); ++i)
    {
        (*i)->execute();
    }
}
